﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ThridGroup.ERP.DTO.ProductionSystem.RepairOrderDto;
using Volo.Abp.Application.Services;

namespace ThridGroup.ERP.ProductionSystem
{
    /// <summary>
    /// 维修单查询结果
    /// </summary>
    public class RepairOrderQueryResult
    {
        /// <summary>
        /// 数据列表
        /// </summary>
        public List<QueryRepairOrderDto> Data { get; set; } = new List<QueryRepairOrderDto>();
        
        /// <summary>
        /// 总记录数
        /// </summary>
        public int TotalCount { get; set; }
    }

    /// <summary>
    /// 维修单接口
    /// </summary>
    public interface IRepairOrderServices : IApplicationService
    {
        /// <summary>
        /// 添加维修单
        /// </summary>
        /// <param name="dto">维修单信息</param>
        /// <returns></returns>
        Task<int> CreateRepairOrder(QueryRepairOrderDto dto);

        /// <summary>
        /// 查询维修单（分页/条件）
        /// </summary>
        /// <param name="dto">查询条件</param>
        /// <returns></returns>
        Task<RepairOrderQueryResult> QueryRepairOrder(GetRepairOrderDto dto);

        /// <summary>
        /// 修改维修单
        /// </summary>
        /// <param name="dto">维修单信息</param>
        /// <returns></returns>
        Task<int> UpdateRepairOrder(QueryRepairOrderDto dto);

        /// <summary>
        /// 批量删除维修单
        /// </summary>
        /// <param name="ids">维修单ID列表</param>
        /// <returns></returns>
        Task BatchDeleteRepairOrder(List<int> ids);

        /// <summary>
        /// 根据ID获取维修单信息
        /// </summary>
        /// <param name="id">维修单ID</param>
        /// <returns></returns>
        Task<QueryRepairOrderDto> GetRepairOrderById(int id);

        /// <summary>
        /// 根据ID获取维修单信息修改单据状态
        /// </summary>
        /// <param name="id">维修单ID</param>
        /// <returns></returns>
        Task<int> GetRepairOrderStatus(int id);
    }
}
